package com.mc.jf.service.impl;

import com.mc.jf.entity.Member;
import com.mc.jf.mapper.MemberMapper;
import com.mc.jf.service.IMemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Lin
 * @since 2022-08-19
 */
@Service
public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> implements IMemberService {
    public Member findParentMember(String id) {
        Member member=baseMapper.selectById(id);
        if (member!=null){
            return baseMapper.findParentMember(String.valueOf(member.getPId()));
        }else {
            return null;
        }

    }

    public List<Member> findMemberByParentId(String pId) {
      return baseMapper.findMemberByParentId(pId);
    }

    public List<Member> findMemberByParentIds(String pId) {
      return baseMapper.findMemberByParentIds(pId);
    }
}
